<h3 style="margin: 10px 0 0 0; padding:0; text-align: center;">Danh sách ảnh</h3>
<div class="content">
    <form action="<?php echo $this->baseUrl('admincp/image'); ?>" method="post">
    <input type="hidden" name="type" value="<?php echo $this->image['type']; ?>" />
    <input type="hidden" name="hotel_id" value="<?php echo $this->image['hotel_id']; ?>" />
    <p style="float: right; margin-right: 15px">Tổng số: <?php echo $this->total; ?> kết quả</p><br/>
    <table class="list-records">
        <tr class="list-header">
            <td style="width: 400px;">Tiêu đề</td>
            <td style="width: 80px;">Ảnh</td>
            <td style="width: 70px;">Trạng thái</td>
            <td colspan="2" style="width: 80px;">Tùy chọn</td>
            <td style="width: 25px;"><?php echo $this->formCheckbox('check_all', null, array('id' => 'check_all', 'onClick' => 'checkAll()')); ?></td>
        </tr>
        <?php if(count($this->data) > 0) :
            $common = new Admincp_Model_Common();
            foreach($this->data as $value) : ?>
        <tr>
            <td><?php echo $value['name']; ?></td>
            <td style="text-align: center;">
                <img width="40px" height="40px" src="<?php echo $this->baseUrl('/public/files/image/').$value['image']; ?>" />
            </td>
            <td style="text-align: center;">
                <a href="<?php echo $this->baseUrl('admincp/image/publish?id=').$value['id'].'&status='.$value['status']; ?>">
                <?php if($value['status'] == '1') : ?>
                    <img src="<?php echo $this->baseUrl(''); ?>public/templates/admin/images/publish.png" />
                <?php else : ?>
                    <img src="<?php echo $this->baseUrl(''); ?>public/templates/admin/images/unpublish.png" />
                <?php endif; ?>
                </a>
            </td>
            <td class="tools">
                <a href="<?php echo $this->baseUrl('admincp/image/edit?id=').$value['id'].'&type='.$this->image['type'].'&hotel_id='.$this->image['hotel_id']; ?>">
                    <img src="<?php echo $this->baseUrl(''); ?>public/templates/admin/images/edit.png" />
                </a>
            </td>
            <td class="tools">
                <a href="<?php echo $this->baseUrl('admincp/image/delete?id=').$value['id'].'&type='.$this->image['type'].'&hotel_id='.$this->image['hotel_id']; ?>" onclick="return remove_alert()">
                    <img src="<?php echo $this->baseUrl(''); ?>public/templates/admin/images/remove.png" />
                </a>
            </td>
            <td class="tools"><?php echo $this->formCheckbox('check[]', $value['id']); ?></td>
        </tr>
        <?php endforeach; ?>
        <?php else : ?>
        <tr>
            <td colspan="7" style="font-style: italic;">Không tìm thấy kết quả nào</td>
        </tr>
        <?php endif; ?>
    </table>
    
    <div class="list-bottom">
        <?php if(count($this->data) > 0) : ?>
        <div class="pagination">
            <?php
    	        $currentUrl = '/?type='.$this->image['type'].'&hotel_id='.$this->image['hotel_id'];
    	        echo $this->paginationControl($this->data, 'Sliding', 'image/pagination.phtml', array('currentUrl' => $currentUrl));
            ?>
        </div>
        <?php endif; ?>
        
        <div class="list-buttons">
            <?php echo $this->formSubmit('add','Tạo mới',array('class'=>'button')); ?>
            <?php echo $this->formSubmit('refresh','Làm mới',array('class'=>'button')); ?>
            <?php echo $this->formSubmit('delete','Xóa',array('class'=>'button','onClick'=>'return remove_alert()')); ?>
        </div>
    </div>
    </form>
</div>